#!/bin/bash
origin_path=$PWD

cd spirecv/algorithm/autofocus_det/AutoFocusDetCppNodes
mkdir build
cd build
cmake ..
make

cd $origin_path

gnome-terminal --tab -e 'bash -c  "python spirecv/dataloader/CameraNode.py params/spirecv2/camera_usb-1280x720_params.json; exec bash;"'
sleep 1
gnome-terminal --tab -e 'bash -c  "python spirecv/algorithm/common_det/YOLOv11DetJetsonTensorRTNode.py params/spirecv2/air2air_c3_640_params_2024-12-13.json --job-name 640_drone_det --input-topic /live/sensor/image_raw; exec bash;"'
sleep 1
gnome-terminal --tab -e 'bash -c  "python spirecv/algorithm/common_det/YOLOv11DetJetsonTensorRTNode.py params/spirecv2/air2air_c3_1280_params_2024-12-13.json --job-name 1280_drone_det --input-topic /live/sensor/image_raw; exec bash;"'
sleep 1
gnome-terminal --tab -e 'bash -c  "./spirecv/algorithm/autofocus_det/AutoFocusDetCppNodes/build/SV2AutoFocusDemo live 1280_drone_det 640_drone_det params/spirecv2/autofocus_det_params_air2air_c3.json; exec bash;"'
sleep 1
gnome-terminal --tab -e 'bash -c  "python spirecv/visualizer/DetectionVisNode.py /live/autofocus/image_results; exec bash;"'
sleep 1
gnome-terminal --tab -e 'bash -c  "./spirecv/saver/SaverCppNodes/build/SV2SaverDemo params/spirecv2/saver_cpp_1280x720.json /live/autofocus/image_results; exec bash;"'

